package com.framework.bdt;

import java.io.File;
import java.io.Serializable;

import com.framework.util.CommonUtil;

public class FileBdt implements Serializable {

	private static final long serialVersionUID = 843653883730000515L;

	protected File file;											// 파일
	private String folderName;								// 폴더명
	protected String fileName;								// 파일명
	protected String originalFileName;						// 실제 저장될 파일명

	public FileBdt(File file){
		this.file = file;
		this.fileName = file.getName();
		this.originalFileName = CommonUtil.getUniqueStr();
	}
	public File getFile() {
		return file;
	}
	public String getFileName() {
		return fileName;
	}
	public String getOriginalFileName() {
		return originalFileName;
	}
	public String getOriginalFileNameExtension(){
		return this.originalFileName + "." + CommonUtil.getFileExtension(file);
	}
	public String getFolderName() {
		return folderName;
	}
	public void setFolderName(String folderName) {
		this.folderName = folderName;
	}
	public String getFileExtension() {
		return CommonUtil.getFileExtension(file);
	}
	public boolean isEmpty(){
		return null == file || 0 == file.length();
	}
}
